<?php
jimport('joomla.application.component.controller');
class AppController extends JController{
	function  display(){
		parent::display();
	}
	
	public function save(){
		//Khoi tao doi tuong app;
		$path = JPATH_COMPONENT_ADMINISTRATOR.DS.'tables';
		JTable::addIncludePath($path);
		$tblApp = JTable::getInstance('app', 'Table');
		//var_dump(JRequest::get('post'));
		//var_export(JRequest::get('post'));
		//Lay du lieu tu Form (client)
		$tblApp->bind(JRequest::get('post'));

		//Luu du lieu xuong csdl
		$tblApp->store();
		
		//Thuc thi view & model
		$this->display();
		JFactory::getApplication()->enqueueMessage('Thêm app thành công, app đang chờ duyệt!');
	}
}